package com.expdatacloud.controller.mvc;

import com.expdatacloud.utils.SaveWhseIdToCookie;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @author jie
 * @date 2019/11/21 -21:04
 */
@Controller
public class WebMvcController {

    /**
     * IQC质检
     */
    @GetMapping("/iqc/iqcManager")
    public String toIqcManager(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/iqc/iqcManager";
    }

    /**
     * IQC来料明细表
     */
    @GetMapping("report/iqc/inspectionDaily")
    public String toInspectionDaily(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/iqc/inspectionDaily";
    }
    /**
     * IQC来料检验十佳供应商
     */
    @GetMapping("/report/iqc/suppliedMaterialsGoodTop10Report")
    public String toSuppliedMaterialsGoodTop10Report(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/iqc/suppliedMaterialsGoodTop10Report";
    }

    /**
     * IQC来料检验十差供应商
     */
    @GetMapping("/report/iqc/suppliedMaterialsBadTop10Report")
    public String tosuppliedMaterialsBadTop10Report(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/iqc/suppliedMaterialsBadTop10Report";
    }
    /**
     * 收货预定看板
     */
    @GetMapping("/report/receivingOrder")
    public String toReceivingOrder(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/receivingOrder";
    }

    /**
     * 质检合格未上架看板
     */
    @GetMapping("/report/unQualifiedQuality")
    public String toUnQualifiedQuality(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/unQualifiedQuality";
    }
    /**
     * 质检不合格未上架看板
     */
    @GetMapping("/report/qualifiedQuality")
    public String toQualifiedQuality(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/qualifiedQuality";
    }
    /**
     * 质检不合格未上架看板
     */
    @GetMapping("/store/storeDifference")
    public String toStore(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/store/storeDifference";
    }

    /**
     * 超期物料重检表
     */
    @GetMapping("/report/getOverdueMaterial")
    public String getOverdueMaterial(String whseid, String users,
                               HttpServletResponse response,
                               HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/getOverdueMaterial";
    }

    /**
     * 不良品及验退超3天明细表
     */
    @GetMapping("/report/basSkuThreeDays")
    public String toBadSkuOverThreeDays(String whseid, String users,
                                     HttpServletResponse response,
                                     HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/report/basSkuThreeDays";
    }

    /**
     * 事务Bin卡查询
     */
    @GetMapping("/itrn/binItrn")
    public String toBinItrn(String whseid, String users,
                                        HttpServletResponse response,
                                        HttpSession session) {
        SaveWhseIdToCookie.setWhseIdSaveToCookie(whseid, users, response, session);
        return "/itrn/binItrn";
    }
}
